package entity

import "gorm.io/gorm"

// User user表模型
type User struct {
	ID       int64  `gorm:"column:id;type=int;not null;primaryKey;autoIncrement"`
	Name     string `gorm:"type=varchar(255);not null"`
	Password string `gorm:"type=varchar(255);not null"`
}

func (User) TableName() string {
	return "user"
}

// GetUser 获得 user 模型
func GetUser(db *gorm.DB) *gorm.DB {
	return db.Model(new(User))
}
